unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70036: 30.0.50; Move file-truename to the C level
@ 2024-03-27 19:08 Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-03-27 19:44 ` Eli Zaretskii
                   ` (3 more replies)
  0 siblings, 4 replies; 96+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-03-27 19:08 UTC (permalink / raw)
  To: 70036

[-- Attachment #1: Type: text/plain, Size: 2405 bytes --]



Hi, all!

During the last couple of weeks I've been studying Eglots performance
and have been noticing a couple of things that I find very
interesting. It seems like `file-truename` is in the hot path due to the
fact that every request to the lsp server has to create the source file
location, and in every response we have to parse the location the
relevant file. `file-truename` is used for this, and its performance
isn't really up to snuff for what it provides, afaict.

Below I've supplied some benchmarks and profile reports along with the
actual patch. Before we discuss the patch itself, I want to get some
answers to the following:

 - Is there a reason that this function should be supplied at the lisp
   level?
 - Does it have to be recursive? It seems to eat up a lot of stack, and
   the comments in the file suggest that has been an issue before.

Firstly, I'll show some benchmarks

```
;; Emacs 29 branch

(benchmark-run 10000
  (file-truename "~/Work/some/long/path/to/parse/that/is/very/deep/deep/deep/super/duper/deep/deep.el"))
;; (1.810892642 1 0.051070616)


;; With new C implementation

(benchmark-run 10000
  (file-truename "~/Work/some/long/path/to/parse/that/is/very/deep/deep/deep/super/duper/deep/deep.el"))
;; (0.018811035 0 0.0)
```

As you can see, the C implementation, though naive for now is two orders
of magnitude faster, and makes a noticeable difference when running an
lsp server in emacs.

As for the patch - it now relies on wordexp to resolve the paths, and I
believe there is no real feature parity with the old variant as for now,
but I haven't seen any issues thus far. If this approach is accepted I
will of course make sure we have feature parity, unless that isn't
wanted.

As for the profiles - it is very clear the performance is better with my
version, as it doesn't really show up in the profiles, but in the
current state `file-truename` seems to eat up around 10-20% of the total
samplings.

And lastly - I've noticed that `redisplay_internal (C function)` shows
up as a _huge_ chunk in emacs 30, but not in emacs 29. Is this a known
issue, or something to look out for? I could open a different bug report
for this if needed.

Below are the profiles and the patch. On my system I needed to `ln -s
lisp/loadup.el .` to make it compile. Not sure if that is due to
differences between old and new `file-truename`, or something else.

Thanks,

Theo


[-- Attachment #2: emacs-29-before-everything --]
[-- Type: application/octet-stream, Size: 11650 bytes --]

          65  31% - jsonrpc--process-filter
          61  29%  - jsonrpc-connection-receive
          49  24%   - #<compiled -0xbf50d04bcfd4f4b>
          29  14%    - eglot--hover-info
          29  14%     - mapconcat
          29  14%      - eglot--format-markup
          14   6%       - gfm-view-mode
          10   4%        - byte-code
           4   1%         - require
           1   0%          - defvar
           1   0%           - define-keymap
           1   0%            - keymap-set
           1   0%             - keymap--check
           1   0%                key-valid-p
           6   2%       - font-lock-ensure
           3   1%        - #<compiled -0x19e2d10a955dad87>
           3   1%         - font-lock-fontify-region
           3   1%          - c-font-lock-fontify-region
           3   1%           - font-lock-default-fontify-region
           3   1%            - font-lock-fontify-keywords-region
           2   0%             - c-font-lock-declarations
           2   0%              - c-find-decl-spots
           2   0%               - #<compiled -0xe9c9c536033cf90>
           2   0%                - c-forward-decl-or-cast-1
           2   0%                 - c-forward-type
           2   0%                  - c-forward-name
           1   0%                   - c-forward-<>-arglist
           1   0%                    - c-forward-<>-arglist-recur
           1   0%                     - c-forward-type
           1   0%                        c-forward-keyword-clause
           1   0%             - #<compiled 0xfe79bfcdb7014df>
           1   0%                c-beginning-of-decl-1
           3   1%        - font-lock-set-defaults
           3   1%         - font-lock-compile-keywords
           3   1%          - mapcar
           3   1%           - font-lock-compile-keyword
           3   1%            - eval
           3   1%             - list
           3   1%              - progn
           2   0%               - unless
           2   0%                - if
           2   0%                 - c-face-name-p
           2   0%                  - face-list
           2   0%                     maphash
           4   1%       - java-mode
           3   1%        - c-common-init
           2   0%         - c-basic-common-init
           2   0%          - c-set-style
           2   0%           - mapc
           2   0%            - #<compiled 0x1170c390a66532e1>
           2   0%             - c-set-style-1
           2   0%              - mapcar
           2   0%                 #<compiled 0x1892a0c8da397cc8>
           1   0%         - c-font-lock-init
           1   0%          - mapcar
           1   0%             c-mode-symbol
           1   0%        - c-init-language-vars-for
           1   0%         - c-make-keywords-re
           1   0%            regexp-opt
          20   9%    - #<compiled 0x138508d9b11649a6>
          20   9%     - #<compiled 0x3532fdd8350189a>
          20   9%      - run-hook-with-args
          20   9%       - eldoc-display-in-echo-area
          18   8%        - eldoc--message
          18   8%         - eldoc-minibuffer-message
          18   8%          - apply
          13   6%             message
           2   0%        - eldoc--echo-area-substring
           2   0%           substitute-command-keys
          10   4%   - jsonrpc--log-event
           8   3%    - pp-to-string
           8   3%     - pp-buffer
           5   2%      - down-list
           5   2%         syntax-ppss
           2   0%      - indent-sexp
           2   0%       - lisp-indent-calc-next
           1   0%          calculate-lisp-indent
           1   0%        up-list
           1   0%    - jsonrpc--events-buffer-scrollback-size
           1   0%     - apply
           1   0%        #<compiled -0x455ec6e2c68d407>
           1   0%   - #<compiled -0x22ca92508a0e1dc>
           1   0%    - mapcar
           1   0%     - #<compiled 0xda6c796629db7f7>
           1   0%      - eglot--range-region
           1   0%         eglot--lsp-position-to-point
           2   0%  - #<compiled -0x1c74af7641681def>
           2   0%   - kill-buffer
           2   0%      replace-buffer-in-windows
           1   0%    generate-new-buffer
          60  29% - command-execute
          60  29%  - call-interactively
          59  28%   - byte-code
          59  28%    - read-extended-command
          59  28%     - read-extended-command-1
          59  28%      - completing-read
          59  28%       - completing-read-default
          38  18%        - read-from-minibuffer
          13   6%         - command-execute
           9   4%          - call-interactively
           9   4%           - funcall-interactively
           9   4%            - minibuffer-complete-and-exit
           9   4%             - completion-complete-and-exit
           9   4%              - completion--complete-and-exit
           8   3%               - try-completion
           8   3%                - #<compiled 0x1bf3e3a951e865d9>
           8   3%                   complete-with-action
           1   0%                 test-completion
           1   0%         - redisplay_internal (C function)
           1   0%          - eval
           1   0%             flymake--mode-line-counter
           1   0%   - funcall-interactively
           1   0%    - execute-extended-command
           1   0%     - command-execute
           1   0%      - call-interactively
           1   0%       - funcall-interactively
           1   0%          profiler-stop
          55  26% - timer-event-handler
          55  26%  - apply
          51  25%   - #<compiled -0xdafdfebeede7b62>
          51  25%    - eldoc-print-current-symbol-info
          51  25%     - eldoc--invoke-strategy
          51  25%      - eldoc-documentation-compose
          50  24%       - eldoc--documentation-compose-1
          50  24%        - run-hook-wrapped
          50  24%         - #<compiled 0xf55a170ff80dfc9>
          25  12%          - eglot-signature-eldoc-function
          18   8%           - eglot--TextDocumentPositionParams
          18   8%            - eglot--TextDocumentIdentifier
          18   8%             - eglot--path-to-uri
          15   7%              - file-truename
          14   6%               - file-truename
          14   6%                - file-truename
          11   5%                 - file-truename
          11   5%                  - file-truename
          11   5%                   - file-truename
          10   4%                    - file-truename
          10   4%                     - file-truename
           8   3%                      - file-truename
           8   3%                       - file-truename
           8   3%                        - file-truename
           5   2%                         - file-truename
           3   1%                          - file-truename
           2   0%                           - file-truename
           1   0%                              file-truename
           1   0%                url-hexify-string
           1   0%              - file-local-name
           1   0%                 file-remote-p
           7   3%           - jsonrpc-async-request
           7   3%            - apply
           7   3%             - jsonrpc--async-request-1
           7   3%              - jsonrpc-connection-send
           7   3%               - apply
           7   3%                - #<compiled -0x4abc9b84fa7c2a4>
           6   2%                 - jsonrpc--log-event
           6   2%                  - pp-to-string
           4   1%                   - pp-buffer
           3   1%                    - down-list
           2   0%                       syntax-ppss
           1   0%                    - indent-sexp
           1   0%                       lisp-indent-calc-next
          25  12%          - eglot-hover-eldoc-function
          11   5%           - eglot--highlight-piggyback
           7   3%            - eglot--TextDocumentPositionParams
           7   3%             - eglot--TextDocumentIdentifier
           7   3%              - eglot--path-to-uri
           6   2%               - file-truename
           5   2%                - file-truename
           4   1%                 - file-truename
           4   1%                  - file-truename
           4   1%                   - file-truename
           3   1%                    - file-truename
           3   1%                     - file-truename
           3   1%                      - file-truename
           2   0%                       - file-truename
           2   0%                        - file-truename
           1   0%                           file-truename
           4   1%            - jsonrpc-async-request
           4   1%             - apply
           4   1%              - jsonrpc--async-request-1
           2   0%               - jsonrpc-connection-send
           2   0%                - apply
           2   0%                 - #<compiled -0x4abc9b84fa7c2a4>
           2   0%                  - jsonrpc--log-event
           2   0%                   - pp-to-string
           1   0%                      pp-buffer
           1   0%               - #<compiled 0x1547f373ce8e51b2>
           1   0%                - run-with-timer
           1   0%                 - apply
           1   0%                  - run-at-time
           1   0%                     timer-relative-time
           1   0%               - jsonrpc--next-request-id
           1   0%                - apply
           1   0%                   #<compiled -0xdff803ba46c02e5>
          10   4%           - eglot--TextDocumentPositionParams
          10   4%            - eglot--TextDocumentIdentifier
          10   4%             - eglot--path-to-uri
           8   3%              - file-truename
           8   3%               - file-truename
           8   3%                - file-truename
           8   3%                 - file-truename
           7   3%                  - file-truename
           7   3%                   - file-truename
           6   2%                    - file-truename
           4   1%                     - file-truename
           3   1%                      - file-truename
           1   0%                         file-truename
           2   0%              - url-hexify-string
           2   0%               - mapconcat
           1   0%                  #<compiled 0x1e6ca0cb85a458bc>
           4   1%           - jsonrpc-async-request
           4   1%            - apply
           4   1%             - jsonrpc--async-request-1
           4   1%              - jsonrpc-connection-send
           4   1%               - apply
           4   1%                - #<compiled -0x4abc9b84fa7c2a4>
           3   1%                 - jsonrpc--log-event
           3   1%                  - pp-to-string
           2   0%                   - pp-buffer
           2   0%                    - indent-sexp
           1   0%                       indent-line-to
           1   0%                       lisp-indent-calc-next
           1   0%                   jsonrpc--json-encode
           3   1%     #<compiled 0x12c6d7b54a1d6d26>
           1   0%   - show-paren-function
           1   0%    - show-paren--default
           1   0%       syntax-ppss
          21  10% - eldoc-pre-command-refresh-echo-area
          21  10%  - eldoc--message
          21  10%   - eldoc-minibuffer-message
          21  10%      apply
           3   1% - redisplay_internal (C function)
           3   1%  - eval
           1   0%     flymake--mode-line-counter
           0   0% + ...

[-- Attachment #3: emacs-30-before --]
[-- Type: application/octet-stream, Size: 16375 bytes --]

         209  43% - timer-event-handler
         209  43%  - apply
         187  39%   - #<compiled-function 978>
         179  37%    - jsonrpc-connection-receive
         104  21%     - #<compiled-function F7B>
         104  21%      - apply
         104  21%       - eglot-handle-notification
         104  21%        - apply
         104  21%         - #<compiled-function 604>
          90  18%          - find-buffer-visiting
          73  15%           - file-truename
          61  12%            - file-truename
          58  12%             - file-truename
          51  10%              - file-truename
          46   9%               - file-truename
          43   9%                - file-truename
          41   8%                 - file-truename
          36   7%                  - file-truename
          34   7%                   - file-truename
          28   5%                    - file-truename
          22   4%                     - file-truename
          15   3%                      - file-truename
          10   2%                       - file-truename
           5   1%                        - file-truename
           1   0%                           file-truename
           5   1%             abbreviate-file-name
           8   1%          - eglot-uri-to-path
           7   1%           - url-generic-parse-url
           2   0%            - #<compiled-function 548>
           2   0%               kill-buffer
           1   0%              match-string
           1   0%           - eglot--trampish-p
           1   0%            - project-root
           1   0%             - apply
           1   0%              - #<compiled-function 5D8>
           1   0%                 gethash
           5   1%            eglot--make-diag
           1   0%            expand-file-name
          65  13%     - jsonrpc--continue
          63  13%      - #<compiled-function A70>
          56  11%       - eglot--hover-info
          56  11%        - eglot--format-markup
          40   8%         - gfm-view-mode
          13   2%          - defalias
           8   1%           - file-name-sans-extension
           1   0%              file-name-sans-versions
           9   1%          - byte-code
           8   1%           - require
           2   0%            - defalias
           2   0%               file-name-sans-extension
           1   0%            - custom-declare-face
           1   0%             - face-spec-set
           1   0%              - face-spec-recalc
           1   0%               - face-attribute
           1   0%                  face-attribute-relative-p
           1   0%           - custom-declare-variable
           1   0%            - custom-initialize-reset
           1   0%             - eval
           1   0%              - funcall
           1   0%               - #<compiled-function DF3>
           1   0%                - executable-find
           1   0%                   locate-file
           4   0%            require
           4   0%          - read-only-mode
           4   0%           - view-mode-enter
           1   0%            - defalias
           1   0%               file-name-sans-extension
           3   0%            read
           3   0%          - gfm-mode
           3   0%           - markdown-mode
           2   0%            - syntax-propertize
           2   0%             - markdown-syntax-propertize
           1   0%              - markdown-syntax-propertize-list-items
           1   0%               - markdown--cur-list-item-bounds
           1   0%                - markdown-cur-list-item-end
           1   0%                 - markdown-prev-line-blank
           1   0%                    looking-at
           1   0%              - markdown-syntax-propertize-pre-blocks
           1   0%                 format
           1   0%              add-hook
           1   0%          - custom-declare-face
           1   0%           - face-spec-set
           1   0%            - make-empty-face
           1   0%               make-face
          13   2%         - font-lock-ensure
          13   2%          - #<compiled-function 46D>
          13   2%           - font-lock-fontify-region
          13   2%            - font-lock-default-fontify-region
           8   1%             - font-lock-fontify-keywords-region
           2   0%              - markdown-fontify-inline-links
           2   0%               - markdown-match-generic-links
           1   0%                - markdown-range-property-any
           1   0%                   number-sequence
           1   0%                  re-search-forward
           1   0%              - markdown-match-pandoc-metadata
           1   0%               - markdown-match-generic-metadata
           1   0%                  re-search-forward
           1   0%              - markdown-match-bold
           1   0%               - markdown-match-inline-generic
           1   0%                  re-search-forward
           1   0%              - markdown-fontify-sub-superscripts
           1   0%               - markdown-search-until-condition
           1   0%                - apply
           1   0%                   re-search-forward
           1   0%              - markdown-fontify-plain-uris
           1   0%               - markdown-match-plain-uris
           1   0%                - markdown-match-inline-generic
           1   0%                 - markdown-code-block-at-pos
           1   0%                  - markdown-get-enclosing-fenced-block-construct
           1   0%                     cl-find-if
           1   0%              - markdown-match-code
           1   0%               - markdown-search-until-condition
           1   0%                - apply
           1   0%                   re-search-forward
           5   1%             - font-lock-fontify-syntactically-region
           5   1%              - treesit-font-lock-fontify-region
           4   0%                 treesit-parser-root-node
           1   0%                 treesit--font-lock-fontify-region-1
           3   0%         - java-ts-mode
           2   0%          - treesit-major-mode-setup
           2   0%           - keymap-set
           2   0%            - keymap--check
           2   0%             - key-valid-p
           2   0%                string-match
           1   0%          - treesit-ready-p
           1   0%             treesit-language-available-p
           7   1%       - #<compiled-function 260>
           6   1%        - #<compiled-function AF0>
           6   1%         - run-hook-with-args
           5   1%          - eldoc-display-in-echo-area
           3   0%           - eldoc--message
           3   0%            - eldoc-minibuffer-message
           3   0%             - message
           3   0%                redisplay_internal (C function)
           1   0%          - eldoc-display-in-buffer
           1   0%             eldoc--format-doc-buffer
           1   0%      - #<compiled-function C3C>
           1   0%       - eglot--check-object
           1   0%          eglot--interface
           1   0%      - (setf jsonrpc--sync-request-alist)
           1   0%         gethash
           8   1%     - apply
           6   1%      - jsonrpc--event
           6   1%       - #<compiled-function FBD>
           6   1%        - apply
           6   1%         - jsonrpc--log-event
           1   0%          - jsonrpc--sync-request-alist
           1   0%             apply
           1   0%      - jsonrpc--reply
           1   0%       - jsonrpc-connection-send
           1   0%        - apply
           1   0%         - #<compiled-function 201>
           1   0%          - jsonrpc--json-encode
           1   0%             json-serialize
           1   0%     - jsonrpc-convert-from-endpoint
           1   0%        cl-type-of
           1   0%       cl--do-remf
           4   0%    - #<compiled-function 157>
           4   0%     - kill-buffer
           2   0%      - replace-buffer-in-windows
           1   0%         unrecord-window-buffer
           1   0%      generate-new-buffer
          21   4%   - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_12>
          21   4%    - eldoc-print-current-symbol-info
          21   4%     - eldoc--invoke-strategy
          21   4%      - eldoc-documentation-compose
          11   2%       - eglot-hover-eldoc-function
           5   1%        - eglot--TextDocumentPositionParams
           5   1%         - eglot--TextDocumentIdentifier
           5   1%          - eglot-path-to-uri
           5   1%           - file-truename
           5   1%            - file-truename
           5   1%             - file-truename
           4   0%              - file-truename
           3   0%               - file-truename
           3   0%                - file-truename
           3   0%                 - file-truename
           1   0%                  - file-truename
           1   0%                   - file-truename
           1   0%                    - file-truename
           1   0%                     - file-truename
           1   0%                        file-truename
           5   1%        - eglot--highlight-piggyback
           5   1%         - eglot--TextDocumentPositionParams
           5   1%          - eglot--TextDocumentIdentifier
           5   1%           - eglot-path-to-uri
           5   1%            - file-truename
           5   1%             - file-truename
           4   0%              - file-truename
           4   0%               - file-truename
           3   0%                - file-truename
           2   0%                 - file-truename
           2   0%                  - file-truename
           2   0%                   - file-truename
           1   0%                      file-truename
           1   0%        - jsonrpc-async-request
           1   0%         - jsonrpc--async-request-1
           1   0%          - jsonrpc-connection-send
           1   0%           - apply
           1   0%            - #<compiled-function 201>
           1   0%               format
          10   2%       - eglot-signature-eldoc-function
          10   2%        - eglot--TextDocumentPositionParams
          10   2%         - eglot--TextDocumentIdentifier
          10   2%          - eglot-path-to-uri
          10   2%           - file-truename
          10   2%            - file-truename
           8   1%             - file-truename
           7   1%              - file-truename
           7   1%               - file-truename
           7   1%                - file-truename
           7   1%                 - file-truename
           7   1%                  - file-truename
           6   1%                   - file-truename
           6   1%                    - file-truename
           6   1%                     - file-truename
           5   1%                      - file-truename
           4   0%                       - file-truename
           3   0%                        - file-truename
           2   0%                         - file-truename
           1   0%                            tramp-completion-file-name-handler
           1   0%                         - tramp-completion-file-name-handler
           1   0%                            tramp-run-real-handler
           1   0%   - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_9>
           1   0%      jit-lock-context-fontify
          94  19% - redisplay_internal (C function)
           8   1%  - eval
           5   1%   - eglot--mode-line-format
           3   0%    - eglot-project-nickname
           1   0%       gethash
           1   0%       cl-type-of
           1   0%       apply
           1   0%    - eglot--progress-reporters
           1   0%     - apply
           1   0%        #<compiled-function CC3>
           2   0%   - if
           2   0%      frame-parameter
           1   0%   - flymake--mode-line-exception
           1   0%    - flymake-reporting-backends
           1   0%       called-interactively-p
          85  17% - #<compiled-function FB8>
          74  15%    native-elisp-load
           7   1%  - comp-run-async-workers
           3   0%   - mapcar
           3   0%      prin1-to-string
           2   0%   - file-name-base
           1   0%      file-name-sans-extension
           1   0%   - write-region
           1   0%    - select-safe-coding-system
           1   0%     - find-auto-coding
           1   0%        auto-coding-alist-lookup
           1   0%     make-process
           2   0%    comp-el-to-eln-filename
           1   0%    delete-file
           1   0%    comp-accept-and-process-async-output
          67  14% - command-execute
          65  13%  - byte-code
          65  13%   - read-extended-command
          65  13%    - read-extended-command-1
          65  13%     - completing-read-default
          65  13%      - apply
          65  13%       - vertico--advice
          65  13%        - apply
          65  13%         - #<subr-native-elisp completing-read-default>
          19   3%          - vertico--exhibit
          13   2%           - vertico--update
          13   2%            - vertico--recompute
          11   2%             - vertico--filter-completions
          11   2%              - completion-all-completions
          11   2%               - completion--nth-completion
          11   2%                - seq-some
          11   2%                 - seq-do
          11   2%                  - mapc
          11   2%                   - #<compiled-function D88>
          11   2%                    - #<compiled-function DBB>
          11   2%                     - orderless-all-completions
          11   2%                      - orderless--filter
          11   2%                       - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
          11   2%                        - complete-with-action
          11   2%                         - all-completions
           4   0%                          - #<compiled-function DE6>
           2   0%                           - #<compiled-function 84E>
           1   0%                              commandp
           2   0%             - vertico-sort-history-length-alpha
           1   0%              - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>
           1   0%                 #<primitive-function string-lessp>
           3   0%           - vertico--arrange-candidates
           3   0%            - vertico--affixate
           3   0%             - read-extended-command--affixation
           1   0%                #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_61>
           3   0%           - vertico--display-candidates
           2   0%            - vertico--resize-window
           2   0%               window-text-pixel-size
           1   0%              move-overlay
          19   3%          - #<compiled-function 12A>
          19   3%             native-elisp-load
          18   3%            redisplay_internal (C function)
           2   0%  - funcall-interactively
           2   0%   - file-notify-handle-event
           2   0%    - file-notify--callback-inotify
           2   0%     - file-notify--handle-event
           2   0%      - file-notify--call-handler
           2   0%       - #<compiled-function 79F>
           1   0%        - #<compiled-function 266>
           1   0%         - #<compiled-function 08F>
           1   0%            re-search-forward
           1   0%        - eglot-path-to-uri
           1   0%         - file-truename
           1   0%          - file-truename
           1   0%           - file-truename
           1   0%              file-truename
          11   2% - apply
          11   2%    native--compile-async
           6   1% - jsonrpc--process-filter
           4   0%  - jsonrpc--json-read
           4   0%     json-parse-buffer
           1   0%  - #<compiled-function 4D6>
           1   0%   - timer-set-time
           1   0%    - timer--time-setter
           1   0%       timerp
           1   0%  - jsonrpc--expected-bytes
           1   0%     gethash
           2   0%   internal-default-process-filter
           1   0% + ...
           1   0% + eldoc-pre-command-refresh-echo-area

[-- Attachment #4: emacs-30-new-file-truename --]
[-- Type: application/octet-stream, Size: 10595 bytes --]

         105  47% - redisplay_internal (C function)
           2   0%  - redisplay--pre-redisplay-functions
           1   0%     run-hook-with-args
           1   0%  - eval
           1   0%   - if
           1   0%      frame-parameter
          55  25% - command-execute
          54  24%  - byte-code
          54  24%   - read-extended-command
          54  24%    - read-extended-command-1
          54  24%     - completing-read-default
          54  24%      - apply
          54  24%       - vertico--advice
          54  24%        - apply
          54  24%         - #<subr-native-elisp completing-read-default>
          19   8%          - vertico--exhibit
          12   5%           - vertico--update
          12   5%            - vertico--recompute
          11   5%             - vertico--filter-completions
          11   5%              - completion-all-completions
          11   5%               - completion--nth-completion
          11   5%                - seq-some
          11   5%                 - seq-do
          11   5%                  - mapc
          11   5%                   - #<compiled-function 210>
          11   5%                    - #<compiled-function 279>
          11   5%                     - orderless-all-completions
          11   5%                      - orderless--filter
          11   5%                       - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
          11   5%                        - complete-with-action
          11   5%                         - all-completions
           8   3%                          - #<compiled-function 9CB>
           4   1%                           - #<compiled-function 5C0>
           3   1%                              commandp
           1   0%                             version-to-list
           1   0%             - vertico-sort-history-length-alpha
           1   0%              - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_14>
           1   0%                 #<primitive-function string-lessp>
           5   2%           - vertico--arrange-candidates
           4   1%            - vertico--affixate
           4   1%             - read-extended-command--affixation
           3   1%                #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_61>
           1   0%            - vertico--window-width
           1   0%               get-buffer-window-list
           1   0%           - vertico--display-count
           1   0%              vertico--format-count
           1   0%           - vertico--display-candidates
           1   0%            - vertico--resize-window
           1   0%               window-text-pixel-size
          18   8%          - redisplay_internal (C function)
           1   0%             redisplay--pre-redisplay-functions
           1   0%          - timer-event-handler
           1   0%           - apply
           1   0%            - show-paren-function
           1   0%             - show-paren--default
           1   0%                show-paren--locate-near-paren
           1   0%  - funcall-interactively
           1   0%     execute-extended-command
          53  24% - timer-event-handler
          53  24%  - apply
          37  16%   - #<compiled-function A34>
          36  16%    - jsonrpc-connection-receive
          36  16%     - jsonrpc--continue
          34  15%      - #<compiled-function 1A6>
          31  14%       - eglot--hover-info
          31  14%        - eglot--format-markup
          20   9%         - gfm-view-mode
           5   2%          - byte-code
           4   1%             require
           1   0%           - custom-declare-variable
           1   0%            - custom-handle-keyword
           1   0%               custom-add-to-group
           4   1%          - gfm-mode
           4   1%           - markdown-mode
           4   1%            - syntax-propertize
           2   0%             - markdown-syntax-propertize
           1   0%              - markdown-syntax-propertize-list-items
           1   0%               - markdown--cur-list-item-bounds
           1   0%                  markdown-cur-list-item-end
           1   0%              - markdown-syntax-propertize-pre-blocks
           1   0%               - markdown-calculate-list-levels
           1   0%                  markdown-search-backward-baseline
           2   0%               #<compiled-function BA2>
           3   1%            require
           3   1%          - read-only-mode
           3   1%             view-mode-enter
           1   0%          - custom-declare-face
           1   0%           - face-spec-set
           1   0%            - make-empty-face
           1   0%             - make-face
           1   0%              - make-face-x-resource-internal
           1   0%               - set-face-attributes-from-resources
           1   0%                - set-face-attribute-from-resource
           1   0%                   internal-face-x-get-resource
           6   2%         - font-lock-ensure
           6   2%          - #<compiled-function C5E>
           6   2%           - font-lock-fontify-region
           6   2%            - font-lock-default-fontify-region
           5   2%             - font-lock-fontify-keywords-region
           1   0%              - markdown-match-code
           1   0%               - markdown-search-until-condition
           1   0%                - #<compiled-function ECA>
           1   0%                 - markdown-code-block-at-pos
           1   0%                    markdown-get-enclosing-fenced-block-construct
           1   0%              - markdown-fontify-plain-uris
           1   0%               - markdown-match-plain-uris
           1   0%                - markdown-match-inline-generic
           1   0%                   markdown-match-inline-generic
           1   0%              - markdown-fontify-inline-links
           1   0%               - markdown-match-generic-links
           1   0%                  markdown-end-of-text-block
           1   0%              - markdown-match-bold
           1   0%                 markdown-match-inline-generic
           1   0%             - font-lock-fontify-syntactically-region
           1   0%              - treesit-font-lock-fontify-region
           1   0%                 treesit--font-lock-fontify-region-1
           2   0%         - java-ts-mode
           1   0%          - prog-mode
           1   0%           - magit-auto-revert-mode-cmhh
           1   0%              add-hook
           1   0%         - #<compiled-function 867>
           1   0%            kill-buffer
           1   0%         - string-trim
           1   0%            string-trim-right
           3   1%       - #<compiled-function 150>
           3   1%        - #<compiled-function B0C>
           3   1%         - run-hook-with-args
           2   0%          - eldoc-display-in-echo-area
           2   0%           - eldoc--message
           2   0%            - eldoc-minibuffer-message
           2   0%             - apply
           2   0%              - message
           2   0%                 redisplay_internal (C function)
           1   0%          - eldoc-display-in-buffer
           1   0%           - eldoc--format-doc-buffer
           1   0%            - special-mode
           1   0%             - global-prettify-symbols-mode-cmhh
           1   0%                add-hook
           2   0%      - #<compiled-function 752>
           1   0%         mapc
           1   0%       - mapcar
           1   0%        - #<compiled-function 505>
           1   0%         - eglot-range-region
           1   0%          - eglot--lsp-position-to-point
           1   0%             eglot-move-to-utf-16-linepos
           1   0%      generate-new-buffer
          16   7%   - #<compiled-function F1D>
          16   7%    - eldoc-print-current-symbol-info
          16   7%     - eldoc--invoke-strategy
          16   7%      - eldoc-documentation-compose
          13   5%       - eglot-hover-eldoc-function
           5   2%        - eglot--highlight-piggyback
           4   1%         - jsonrpc-async-request
           4   1%          - jsonrpc--async-request-1
           4   1%           - jsonrpc-connection-send
           4   1%            - apply
           4   1%             - #<compiled-function 835>
           2   0%              - jsonrpc--event
           2   0%               - #<compiled-function 1E3>
           2   0%                - apply
           2   0%                   jsonrpc--log-event
           1   0%                process-send-string
           1   0%         - eglot--TextDocumentPositionParams
           1   0%          - eglot--TextDocumentIdentifier
           1   0%             eglot-path-to-uri
           4   1%        - jsonrpc-async-request
           4   1%         - jsonrpc--async-request-1
           2   0%          - jsonrpc-connection-send
           2   0%           - apply
           2   0%            - #<compiled-function 835>
           2   0%             - jsonrpc--event
           2   0%              - #<compiled-function 2A0>
           2   0%               - apply
           2   0%                  jsonrpc--log-event
           4   1%        - eglot--TextDocumentPositionParams
           4   1%         - eglot--TextDocumentIdentifier
           4   1%          - eglot-path-to-uri
           3   1%             url-generic-parse-url
           3   1%       - eglot-signature-eldoc-function
           2   0%        - jsonrpc-async-request
           2   0%         - jsonrpc--async-request-1
           1   0%          - jsonrpc-connection-send
           1   0%           - apply
           1   0%            - #<compiled-function 835>
           1   0%             - jsonrpc--json-encode
           1   0%                json-serialize
           1   0%          - #<compiled-function FE8>
           1   0%           - run-with-timer
           1   0%            - run-at-time
           1   0%             - timer-activate
           1   0%                timer--activate
           1   0%        - eglot--TextDocumentPositionParams
           1   0%         - eglot--TextDocumentIdentifier
           1   0%            eglot-path-to-uri
           6   2% - eldoc-pre-command-refresh-echo-area
           6   2%  - eldoc--message
           6   2%   - eldoc-minibuffer-message
           6   2%    - apply
           6   2%       message
           1   0%   corfu--auto-post-command
           0   0%   ...

[-- Attachment #5: emacs-Q-30-after-everything --]
[-- Type: application/octet-stream, Size: 10484 bytes --]

         122  39% - redisplay_internal (C function)
           1   0%    file-remote-p
          97  31% - command-execute
          96  30%  - byte-code
          96  30%   - read-extended-command
          96  30%    - read-extended-command-1
          96  30%     - completing-read-default
          46  14%        redisplay_internal (C function)
          16   5%      - command-execute
          16   5%       - funcall-interactively
          16   5%        - minibuffer-complete
          15   4%         - completion-in-region
          15   4%          - completion--in-region
          15   4%           - #<compiled-function E31>
          15   4%            - apply
          15   4%             - #<compiled-function 982>
          15   4%              - completion--in-region-1
          15   4%               - completion--do-completion
          10   3%                - completion-try-completion
          10   3%                 - completion--nth-completion
          10   3%                  - seq-some
          10   3%                   - seq-do
          10   3%                    - mapc
          10   3%                     - #<compiled-function 373>
          10   3%                      - #<compiled-function 1B9>
          10   3%                       - completion-basic-try-completion
          10   3%                        - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
          10   3%                         - complete-with-action
          10   3%                          - try-completion
           1   0%                             #<compiled-function 317>
           4   1%                - minibuffer-completion-help
           2   0%                 - completion-all-completions
           2   0%                  - completion--nth-completion
           2   0%                   - seq-some
           2   0%                    - seq-do
           2   0%                     - mapc
           2   0%                      - #<compiled-function 7FD>
           2   0%                       - #<compiled-function 79E>
           2   0%                        - completion-basic-all-completions
           2   0%                         - completion-pcm--all-completions
           2   0%                          - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_56>
           2   0%                           - complete-with-action
           2   0%                              all-completions
           2   0%                 - temp-buffer-window-show
           2   0%                  - display-buffer
           2   0%                   - display-buffer-at-bottom
           1   0%                    - walk-window-tree
           1   0%                     - walk-window-tree-1
           1   0%                      - #<compiled-function 365>
           1   0%                         window-in-direction
           1   0%                    - window--display-buffer
           1   0%                     - #<compiled-function 38B>
           1   0%                      - read-extended-command--affixation
           1   0%                         #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_61>
           1   0%                - minibuffer-hide-completions
           1   0%                 - bury-buffer
           1   0%                  - window--delete
           1   0%                   - delete-window
           1   0%                    - window-sizable-p
           1   0%                     - window-sizable
           1   0%                      - window-size-fixed-p
           1   0%                         window--size-fixed-1
           1   0%           minibuffer--completion-prompt-end
           1   0%      - timer-event-handler
           1   0%       - apply
           1   0%        - show-paren-function
           1   0%         - show-paren--default
           1   0%          - show-paren--locate-near-paren
           1   0%             back-to-indentation
           1   0%  - funcall-interactively
           1   0%     execute-extended-command
          43  13% - timer-event-handler
          43  13%  - apply
          21   6%   - #<compiled-function E78>
          21   6%    - jsonrpc-connection-receive
          19   6%     - jsonrpc--continue
          17   5%      - #<compiled-function A37>
          10   3%       - #<compiled-function D56>
          10   3%        - #<compiled-function D92>
          10   3%         - run-hook-with-args
           9   2%          - eldoc-display-in-echo-area
           9   2%           - eldoc--message
           9   2%            - eldoc-minibuffer-message
           9   2%             - apply
           9   2%              - message
           7   2%                 redisplay_internal (C function)
           1   0%          - eldoc-display-in-buffer
           1   0%           - eldoc--format-doc-buffer
           1   0%            - special-mode
           1   0%               c-leave-cc-mode-mode
           7   2%       - eglot--hover-info
           7   2%        - eglot--format-markup
           5   1%         - font-lock-ensure
           5   1%          - #<compiled-function C5E>
           5   1%           - font-lock-fontify-region
           5   1%            - c-font-lock-fontify-region
           5   1%             - font-lock-default-fontify-region
           4   1%              - font-lock-fontify-keywords-region
           3   0%               - c-font-lock-declarations
           3   0%                - c-find-decl-spots
           3   0%                 - #<compiled-function F1B>
           3   0%                  - c-forward-decl-or-cast-1
           2   0%                   - c-forward-type
           1   0%                    - c-check-qualified-type
           1   0%                     - c-forward-over-compound-identifier
           1   0%                        c-forward-sws
           1   0%                    - c-forward-name
           1   0%                     - c-forward-<>-arglist
           1   0%                      - c-forward-<>-arglist-recur
           1   0%                       - c-forward-sws
           1   0%                          looking-at
           1   0%                     looking-at
           1   0%               - c-font-lock-enclosing-decls
           1   0%                - c-parse-state
           1   0%                   c-beginning-of-macro
           1   0%              - font-lock-fontify-syntactically-region
           1   0%               - font-lock-default-fontify-syntactically
           1   0%                - comment-normalize-vars
           1   0%                 - #<compiled-function A87>
           1   0%                  - kill-buffer
           1   0%                     replace-buffer-in-windows
           2   0%         - java-mode
           1   0%            c-init-language-vars-for
           1   0%          - c-common-init
           1   0%           - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_35>
           1   0%            - c-unmark-<>-around-region
           1   0%               #<compiled-function D6E>
           2   0%        #<compiled-function 3C6>
           1   0%     - jsonrpc--remove
           1   0%        slot-value
           1   0%     - apply
           1   0%      - jsonrpc--event
           1   0%       - #<compiled-function 0A3>
           1   0%        - apply
           1   0%           jsonrpc--log-event
          12   3%   - #<compiled-function 4BB>
          12   3%    - eldoc-print-current-symbol-info
          12   3%     - eldoc--invoke-strategy
          12   3%      - eldoc-documentation-compose
          12   3%       - eglot-hover-eldoc-function
           6   1%        - eglot--TextDocumentPositionParams
           5   1%         - eglot--TextDocumentIdentifier
           5   1%          - eglot-path-to-uri
           3   0%             url-generic-parse-url
           1   0%         - eglot--pos-to-lsp-position
           1   0%          - eglot-utf-16-linepos
           1   0%             eglot--bol
           4   1%        - eglot--highlight-piggyback
           2   0%         - eglot--TextDocumentPositionParams
           2   0%          - eglot--TextDocumentIdentifier
           2   0%           - eglot-path-to-uri
           2   0%            - url-generic-parse-url
           1   0%             - #<compiled-function D46>
           1   0%                kill-buffer
           2   0%         - jsonrpc-async-request
           2   0%          - jsonrpc--async-request-1
           1   0%           - jsonrpc-connection-send
           1   0%            - apply
           1   0%             - #<compiled-function 510>
           1   0%                jsonrpc--event
           2   0%        - jsonrpc-async-request
           2   0%         - jsonrpc--async-request-1
           2   0%          - jsonrpc-connection-send
           2   0%           - apply
           2   0%            - #<compiled-function 510>
           1   0%             - jsonrpc--event
           1   0%              - #<compiled-function 82A>
           1   0%               - apply
           1   0%                  jsonrpc--log-event
           1   0%             - jsonrpc--json-encode
           1   0%                json-serialize
           6   1%   - #<subr-native-elisp F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_9>
           6   1%      jit-lock-context-fontify
           3   0%   - show-paren-function
           3   0%    - show-paren--default
           2   0%     - syntax-ppss
           1   0%        parse-partial-sexp
           1   0%        syntax-propertize
           1   0%       show-paren--locate-near-paren
           1   0%   - blink-cursor-start
           1   0%      blink-cursor--start-timer
          40  12%   Automatic GC
           4   1% - eldoc-pre-command-refresh-echo-area
           4   1%  - eldoc--message
           4   1%   - eldoc-minibuffer-message
           4   1%    - apply
           4   1%       message
           2   0% - jsonrpc--process-filter
           1   0%    search-forward-regexp
           1   0%  - #<compiled-function 79A>
           1   0%     timer-set-time
           1   0% - jit-lock--antiblink-post-command
           1   0%    syntax--lbp
           1   0% - undo-auto--add-boundary
           1   0%  - undo-auto--boundaries
           1   0%     add-to-list
           0   0%   ...

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0001-Move-file-truename-to-the-C-level.patch --]
[-- Type: text/x-diff, Size: 7698 bytes --]

From 183e636eebd9f1653d0cfdacdeba77d2043954af Mon Sep 17 00:00:00 2001
From: Theodor Thornhill <theo@thornhill.no>
Date: Wed, 27 Mar 2024 19:42:56 +0100
Subject: [PATCH] Move file-truename to the C level

---
 lisp/files.el | 116 +++++---------------------------------------------
 src/fileio.c  |  27 ++++++++++++
 2 files changed, 38 insertions(+), 105 deletions(-)

diff --git a/lisp/files.el b/lisp/files.el
index 766ed573392..6b9846c2ef4 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -32,6 +32,8 @@
   (require 'pcase)
   (require 'easy-mmode)) ; For `define-minor-mode'.
 
+(declare-function file-truename "fileio.c")
+
 (defvar font-lock-keywords)
 
 (defgroup backup nil
@@ -1413,111 +1415,15 @@ files--splice-dirname-file
 	unquoted
       (let (file-name-handler-alist) (file-name-quote unquoted)))))
 
-(defun file-truename (filename &optional counter prev-dirs)
-  "Return the truename of FILENAME.
-If FILENAME is not absolute, first expands it against `default-directory'.
-The truename of a file name is found by chasing symbolic links
-both at the level of the file and at the level of the directories
-containing it, until no links are left at any level.
-
-\(fn FILENAME)"  ;; Don't document the optional arguments.
-  ;; COUNTER and PREV-DIRS are used only in recursive calls.
-  ;; COUNTER can be a cons cell whose car is the count of how many
-  ;; more links to chase before getting an error.
-  ;; PREV-DIRS can be a cons cell whose car is an alist
-  ;; of truenames we've just recently computed.
-  (cond ((or (string= filename "") (string= filename "~"))
-	 (setq filename (expand-file-name filename))
-	 (if (string= filename "")
-	     (setq filename "/")))
-	((and (string= (substring filename 0 1) "~")
-	      (string-match "~[^/]*/?" filename))
-	 (let ((first-part
-		(substring filename 0 (match-end 0)))
-	       (rest (substring filename (match-end 0))))
-	   (setq filename (concat (expand-file-name first-part) rest)))))
-
-  (or counter (setq counter (list 100)))
-  (let (done
-	;; For speed, remove the ange-ftp completion handler from the list.
-	;; We know it's not needed here.
-	;; For even more speed, do this only on the outermost call.
-	(file-name-handler-alist
-	 (if prev-dirs file-name-handler-alist
-	   (let ((tem (copy-sequence file-name-handler-alist)))
-	     (delq (rassq 'ange-ftp-completion-hook-function tem) tem)))))
-    (or prev-dirs (setq prev-dirs (list nil)))
-
-    ;; andrewi@harlequin.co.uk - on Windows, there is an issue with
-    ;; case differences being ignored by the OS, and short "8.3 DOS"
-    ;; name aliases existing for all files.  (The short names are not
-    ;; reported by directory-files, but can be used to refer to files.)
-    ;; It seems appropriate for file-truename to resolve these issues in
-    ;; the most natural way, which on Windows is to call the function
-    ;; `w32-long-file-name' - this returns the exact name of a file as
-    ;; it is stored on disk (expanding short name aliases with the full
-    ;; name in the process).
-    (if (eq system-type 'windows-nt)
-	(unless (string-match "[[*?]" filename)
-	  ;; If filename exists, use its long name.  If it doesn't
-	  ;; exist, the recursion below on the directory of filename
-	  ;; will drill down until we find a directory that exists,
-	  ;; and use the long name of that, with the extra
-	  ;; non-existent path components concatenated.
-	  (let ((longname (w32-long-file-name filename)))
-	    (if longname
-		(setq filename longname)))))
-
-    ;; If this file directly leads to a link, process that iteratively
-    ;; so that we don't use lots of stack.
-    (while (not done)
-      (setcar counter (1- (car counter)))
-      (if (< (car counter) 0)
-	  (error "Apparent cycle of symbolic links for %s" filename))
-      (let ((handler (find-file-name-handler filename 'file-truename)))
-	;; For file name that has a special handler, call handler.
-	;; This is so that ange-ftp can save time by doing a no-op.
-	(if handler
-	    (setq filename (funcall handler 'file-truename filename)
-		  done t)
-	  (let ((dir (or (file-name-directory filename) default-directory))
-		target dirfile)
-	    ;; Get the truename of the directory.
-	    (setq dirfile (directory-file-name dir))
-	    ;; If these are equal, we have the (or a) root directory.
-	    (or (string= dir dirfile)
-		(and (file-name-case-insensitive-p dir)
-		     (string-equal-ignore-case dir dirfile))
-		;; If this is the same dir we last got the truename for,
-		;; save time--don't recalculate.
-		(if (assoc dir (car prev-dirs))
-		    (setq dir (cdr (assoc dir (car prev-dirs))))
-		  (let ((old dir)
-			(new (file-name-as-directory (file-truename dirfile counter prev-dirs))))
-		    (setcar prev-dirs (cons (cons old new) (car prev-dirs)))
-		    (setq dir new))))
-	    (if (equal ".." (file-name-nondirectory filename))
-		(setq filename
-		      (directory-file-name (file-name-directory (directory-file-name dir)))
-		      done t)
-	      (if (equal "." (file-name-nondirectory filename))
-		  (setq filename (directory-file-name dir)
-			done t)
-		;; Put it back on the file name.
-		(setq filename (concat dir (file-name-nondirectory filename)))
-		;; Is the file name the name of a link?
-		(setq target (file-symlink-p filename))
-		(if target
-		    ;; Yes => chase that link, then start all over
-		    ;; since the link may point to a directory name that uses links.
-		    ;; We can't safely use expand-file-name here
-		    ;; since target might look like foo/../bar where foo
-		    ;; is itself a link.  Instead, we handle . and .. above.
-		    (setq filename (files--splice-dirname-file dir target)
-			  done nil)
-		  ;; No, we are done!
-		  (setq done t))))))))
-    filename))
+;; (defun file-truename (filename &optional _x _y)
+;;   "Return the truename of FILENAME.
+;; If FILENAME is not absolute, first expands it against `default-directory'.
+;; The truename of a file name is found by chasing symbolic links
+;; both at the level of the file and at the level of the directories
+;; containing it, until no links are left at any level.
+
+;; \(fn FILENAME)"
+;;   (file-truename-c filename))
 
 (defun file-chase-links (filename &optional limit)
   "Chase links in FILENAME until a name that is not a link.
diff --git a/src/fileio.c b/src/fileio.c
index 12da7a9ed3a..05deedead55 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -24,6 +24,8 @@ Copyright (C) 1985-1988, 1993-2024 Free Software Foundation, Inc.
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <wordexp.h>
 
 #ifdef DARWIN_OS
 #include <sys/attr.h>
@@ -367,6 +369,30 @@ restore_point_unwind (Lisp_Object location)
   unchain_marker (XMARKER (location));
 }
 
+DEFUN ("file-truename", Ffile_truename, Sfile_truename,
+       1, 3, 0,
+       doc: /* Return the truename of FILENAME.  */)
+  (Lisp_Object filename, Lisp_Object x, Lisp_Object y)
+{
+  Lisp_Object result = filename;
+
+  CHECK_STRING (filename);
+  char *c_filename = SSDATA (filename);
+
+  wordexp_t we;
+  wordexp(c_filename, &we, 0);
+
+  char *truename = realpath(we.we_wordv[0], NULL);
+  wordfree(&we);
+
+  if (!truename)
+    return result;
+
+  result = build_string(truename);
+  free(truename);
+
+  return result;
+}
 \f
 DEFUN ("find-file-name-handler", Ffind_file_name_handler,
        Sfind_file_name_handler, 2, 2, 0,
@@ -6850,6 +6876,7 @@ do (file-exists-p FILENAME) and FILENAME is handled by HANDLER, then
   DEFSYM (Qstdout, "stdout");
   DEFSYM (Qstderr, "stderr");
 
+  defsubr (&Sfile_truename);
   defsubr (&Sfind_file_name_handler);
   defsubr (&Sfile_name_directory);
   defsubr (&Sfile_name_nondirectory);
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 96+ messages in thread

end of thread, other threads:[~2024-05-02  9:40 UTC | newest]

Thread overview: 96+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 19:08 bug#70036: 30.0.50; Move file-truename to the C level Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 19:44 ` Eli Zaretskii
2024-03-27 21:56   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  1:14     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  3:05       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  7:04         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  7:03       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  6:22     ` Eli Zaretskii
2024-03-28  7:03       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27 20:12 ` Felician Nemeth
2024-03-27 21:43   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  6:03     ` Eli Zaretskii
2024-03-28  7:10       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  8:52         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 11:55         ` Felician Nemeth
2024-03-28 12:08           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30  9:46             ` Felician Nemeth
2024-03-30 11:18               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 12:45               ` Eli Zaretskii
2024-03-31 12:57                 ` Felician Nemeth
2024-03-31 13:32                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  9:22 ` Ihor Radchenko
2024-03-28 10:59   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 11:18     ` Ihor Radchenko
2024-03-28 11:41       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 11:51         ` Ihor Radchenko
2024-03-28 12:47           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 13:52           ` Eli Zaretskii
2024-04-18 15:32 ` bug#70036: a fix that João Távora
2024-04-18 15:39   ` João Távora
2024-04-18 15:40   ` Ihor Radchenko
2024-04-18 15:45     ` João Távora
2024-04-18 15:49   ` Eli Zaretskii
2024-04-18 16:11     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:15       ` João Távora
2024-04-18 16:29         ` Eli Zaretskii
2024-04-18 17:22           ` João Távora
2024-04-18 17:53             ` Eli Zaretskii
2024-04-18 20:21               ` João Távora
     [not found]                 ` <874jbycrd7.fsf@dick>
2024-04-18 21:26                   ` João Távora
2024-04-18 21:37                     ` João Távora
2024-04-19  9:17                       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 21:32                 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 22:06                   ` João Távora
2024-04-18 23:59                     ` João Távora
2024-04-19  6:09                       ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  6:26                         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  8:06                           ` João Távora
2024-04-19  9:05                             ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  8:01                         ` João Távora
2024-04-19  9:10                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  9:22                             ` João Távora
2024-04-19  5:58                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  7:52                       ` João Távora
2024-04-19  9:14                         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19  6:56                     ` Eli Zaretskii
2024-04-19  7:51                       ` Ihor Radchenko
2024-04-19 10:51                         ` Eli Zaretskii
2024-04-30 11:30                           ` Ihor Radchenko
2024-05-02  9:40                             ` Eli Zaretskii
2024-04-19  8:27                       ` João Távora
2024-04-19  8:49                         ` João Távora
2024-04-19 11:12                           ` Eli Zaretskii
2024-04-19 11:34                             ` João Távora
2024-04-19 18:13                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 18:59                                 ` João Távora
2024-04-19 19:42                                   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:01                         ` Eli Zaretskii
2024-04-19 11:32                           ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:40                             ` João Távora
2024-04-19 11:47                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 11:51                                 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:01                                   ` João Távora
2024-04-19 11:51                                 ` João Távora
2024-04-19 20:23                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 21:32                                 ` João Távora
2024-04-19 11:53                             ` Eli Zaretskii
2024-04-19 11:59                               ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:03                               ` João Távora
2024-04-19 12:00                           ` João Távora
2024-04-19 12:13                             ` Eli Zaretskii
2024-04-19 12:20                               ` João Távora
2024-04-19  6:45                   ` Eli Zaretskii
2024-04-19  7:38                     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-19 12:54                     ` João Távora
2024-04-19 14:32                       ` Eli Zaretskii
2024-04-19  0:57                 ` Yuan Fu
2024-04-19  1:20                   ` João Távora
2024-04-22 22:11                 ` Dmitry Gutov
2024-04-18 16:21       ` Eli Zaretskii
2024-04-18 16:12     ` João Távora
2024-04-18 16:24       ` Eli Zaretskii
2024-04-18 16:33         ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-18 16:36           ` Eli Zaretskii
2024-04-18 17:26           ` João Távora
2024-04-18 17:27         ` João Távora

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).