Article View: gnu.emacs.bug
Article #87233ChangeLog with Perl (and also with C++)
From: Francois Pinard
Date: Wed, 05 Oct 1994 12:51
Date: Wed, 05 Oct 1994 12:51
56 lines
2797 bytes
2797 bytes
In GNU Emacs 19.22.1 of Wed Mar 16 1994 on fuzzy (linux)
`C-x 4 a' (add-change-log-entry-other-window) does not recognize and
insert the Perl function name in the automatically preinitialized
entry. Here are a few diffs adding this capability.
This diffset also corrects two typos which *might* prevent function
recognition to work properly with C++.
diff -u -r1.1 add-log.el
--- 1.1 1994/10/05 12:29:59
+++ add-log.el 1994/10/05 12:36:18
@@ -286,7 +286,7 @@
(defun add-log-current-defun ()
"Return name of function definition point is in, or nil.
-Understands C, Lisp, LaTeX (\"functions\" are chapters, sections, ...),
+Understands C, Perl, Lisp, LaTeX (\"functions\" are chapters, sections, ...),
Texinfo (@node titles), and Fortran.
Other modes are handled by a heuristic that looks in the 10K before
@@ -316,7 +316,7 @@
(skip-chars-forward " ")
(buffer-substring (point)
(progn (forward-sexp 1) (point))))))
- ((and (memq major-mode '(c-mode 'c++-mode))
+ ((and (memq major-mode '(c-mode c++-mode))
(save-excursion (beginning-of-line)
;; Use eq instead of = here to avoid
;; error when at bob and char-after
@@ -332,7 +332,7 @@
(skip-chars-forward " \t")
(buffer-substring (point)
(progn (forward-sexp 1) (point))))
- ((memq major-mode '(c-mode 'c++-mode))
+ ((memq major-mode '(c-mode c++-mode))
(beginning-of-line)
;; See if we are in the beginning part of a function,
;; before the open brace. If so, advance forward.
@@ -416,6 +416,10 @@
(point))))))
((eq major-mode 'texinfo-mode)
(if (re-search-backward "^@node[ \t]+\\([^,]+\\)," nil t)
+ (buffer-substring (match-beginning 1)
+ (match-end 1))))
+ ((eq major-mode 'perl-mode)
+ (if (re-search-backward "^sub[ \t]+\\([^ \t\n]+\\)" nil t)
(buffer-substring (match-beginning 1)
(match-end 1))))
((eq major-mode 'fortran-mode)
--
Franc,ois Pinard ``Vivement GNU!'' pinard@iro.umontreal.ca
About the League for Programming Freedom? Email me or lpf@uunet.uu.net
Technical Details
Message-ID:
<m0qsVhR-000067C@icule>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!iro.umontreal.ca!pinardShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,93ca282813700d39,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-10-05 09:23:22 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!howland.reston.ans.net!math.ohio-state.edu!cis.ohio-state.edu!iro.umontreal.ca!pinard From: pinard@iro.umontreal.ca (Francois Pinard) Newsgroups: gnu.emacs.bug Subject: ChangeLog with Perl (and also with C++) Date: 5 Oct 1994 08:51:54 -0400 Organization: GNUs Not Usenet Lines: 56 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <m0qsVhR-000067C@icule>