From: Tino Calancha <f92capac@gmail.com>
To: 22583@debbugs.gnu.org
Subject: bug#22583: 25.1.50; find-function-search-for-symbol don't call find-function-after-hook
Date: Mon, 8 Feb 2016 00:18:13 +0900 (JST) [thread overview]
Message-ID: <alpine.LRH.2.20.1602080013560.4893@calancha-ilc.kek.jp> (raw)
[-- Attachment #1: Type: text/plain, Size: 672 bytes --]
Hi emacs,
when calling find-function or find-variable
find-function-after-hook is run.
In the ther hand, find-function-search-for-symbol
don't run this hook.
For example,
I set find-function-after-hook to always visit source code
in a read-only buffer. This work for find-function/variable.
But sometimes, you call describe-function/describe-variable,
and, after reading the doc. string you decide to take a look
in the implementation. In that cases the buffer may not be
in read-only mode because find-function-after-hook is not called.
In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.29)
Repository revision: 90c647b97f0e62ca8bc2fc1d27f0170136277fb7
[-- Attachment #2: Type: text/plain, Size: 1207 bytes --]
diff --git a/find-func.el b/find-func.el
index 0575ce4..e05f75c 100644
--- a/find-func.el
+++ b/find-func.el
@@ -302,7 +302,10 @@ The search is done in the source for library LIBRARY."
(while (and (symbolp symbol) (get symbol 'definition-name))
(setq symbol (get symbol 'definition-name)))
(if (string-match "\\`src/\\(.*\\.\\(c\\|m\\)\\)\\'" library)
- (find-function-C-source symbol (match-string 1 library) type)
+ (let* ((buf-pos (find-function-C-source symbol (match-string 1 library) type))
+ (buf (car buf-pos)))
+ (when buf (with-current-buffer buf
+ (run-hooks 'find-function-after-hook))) buf-pos)
(when (string-match "\\.el\\(c\\)\\'" library)
(setq library (substring library 0 (match-beginning 1))))
;; Strip extension from .emacs.el to make sure symbol is searched in
@@ -340,6 +343,7 @@ The search is done in the source for library LIBRARY."
"\\_>")
nil t)))
(progn
+ (run-hooks 'find-function-after-hook)
(beginning-of-line)
(cons (current-buffer) (point)))
(cons (current-buffer) nil))))))))
next reply other threads:[~2016-02-07 15:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-07 15:18 Tino Calancha [this message]
2016-02-08 5:01 ` bug#22583: 25.1.50; find-function-search-for-symbol don't call find-function-after-hook Dmitry Gutov
2016-02-08 12:50 ` Tino Calancha
2016-02-18 0:52 ` bug#22583: 25.1.50; find-library " Tino Calancha
2016-02-21 23:27 ` Dmitry Gutov
2016-02-22 0:00 ` John Wiegley
2016-02-22 0:04 ` Dmitry Gutov
2016-02-22 17:01 ` John Wiegley
2016-02-22 17:19 ` Tino Calancha
2016-04-25 17:27 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LRH.2.20.1602080013560.4893@calancha-ilc.kek.jp \
--to=f92capac@gmail.com \
--cc=22583@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.