From 8c249c286eb6ba9c6789b7bf2f50b58ea3e45d06 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 5 Feb 2024 11:19:47 +0900 Subject: Replace Q_SIGNALS and Q_SLOTS Signed-off-by: Michele Calgaro --- scripts/kde-emacs/kde-emacs-core.el | 10 +++++----- scripts/kde-emacs/kde-emacs-semantic.el | 22 +++++++++++----------- scripts/kde-emacs/kde-emacs-vars.el | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'scripts/kde-emacs') diff --git a/scripts/kde-emacs/kde-emacs-core.el b/scripts/kde-emacs/kde-emacs-core.el index 030ffd39..5b09f95c 100644 --- a/scripts/kde-emacs/kde-emacs-core.el +++ b/scripts/kde-emacs/kde-emacs-core.el @@ -151,10 +151,10 @@ With arg, do it arg times." (define-key c++-mode-map "\ef" 'c-forward-into-nomenclature) (define-key c++-mode-map "\ed" 'agulbra-delete-into-nomenclature) (define-key c++-mode-map "\eb" 'c-backward-into-nomenclature) - ;; fontify "public|protected|private Q_SLOTS" with one and the same face :) + ;; fontify "public|protected|private slots" with one and the same face :) ;; NOTE: write face-at-point function to fontify those just like other ;; access specifiers - (font-lock-add-keywords nil '(("\\<\\(\\(public\\|protected\\|private\\) Q_SLOTS\\)\\>" + (font-lock-add-keywords nil '(("\\<\\(\\(public\\|protected\\|private\\) slots\\)\\>" . font-lock-reference-face))) ;; Add (set magic-keys-mode nil) to your .emacs (before loading this file) ;; to disable the magic keys in C++ mode. @@ -866,7 +866,7 @@ This function does not do any hidden buffer changes." (not (bobp)) (save-excursion (c-safe (progn (c-backward-sexp 1) t)) - (and (looking-at "Q_SLOTS:") + (and (looking-at "slots:") (c-backward-sexp 1)) (looking-at c-opt-access-key))) (c-backward-sexp 1) @@ -2116,7 +2116,7 @@ This function does not do any hidden buffer changes." (not (bobp)) (save-excursion (c-safe (progn (c-backward-sexp 1) t)) - (and (looking-at "Q_SLOTS:") + (and (looking-at "slots:") (c-backward-sexp 1)) (looking-at c-opt-access-key))) (c-backward-sexp 1) @@ -3172,7 +3172,7 @@ This function does not do any hidden buffer changes." (save-excursion (c-safe (progn (c-backward-sexp 1) t)) ;; agulbrahack 2 - (and (looking-at "Q_SLOTS:") + (and (looking-at "slots:") (c-backward-sexp 1)) (looking-at c-access-key))) (c-backward-sexp 1) diff --git a/scripts/kde-emacs/kde-emacs-semantic.el b/scripts/kde-emacs/kde-emacs-semantic.el index 5e5c156b..57db7f75 100644 --- a/scripts/kde-emacs/kde-emacs-semantic.el +++ b/scripts/kde-emacs/kde-emacs-semantic.el @@ -148,12 +148,12 @@ token and TOKENS have to be a list of functions from buffer." ret )) -(defmacro kde-label-Q_SIGNALS (pt) - "Returns none-nil if the current access label == \"Q_SIGNALS\"" +(defmacro kde-label-signals (pt) + "Returns none-nil if the current access label == \"signals\"" `(save-excursion (goto-char ,pt) (if (looking-at ":") - (re-search-backward "Q_SIGNALS" (point-at-bol) t) + (re-search-backward "signals" (point-at-bol) t) ) )) @@ -171,13 +171,13 @@ token and TOKENS have to be a list of functions from buffer." ) )) -(defmacro kde-label-Q_SLOTS (pt) - "Return none-nil if at PT there's Q_SLOTS access specifier." +(defmacro kde-label-slots (pt) + "Return none-nil if at PT there's slots access specifier." `(save-excursion (goto-char ,pt) (if (looking-at ":") ;; export this regex to a kde-emacs-vars defvar - (re-search-backward "\\(public\\|protected\\|private\\)[ \t]+Q_SLOTS" (point-at-bol) t)) + (re-search-backward "\\(public\\|protected\\|private\\)[ \t]+slots" (point-at-bol) t)) )) (defmacro kde-is-constructor (function) @@ -304,7 +304,7 @@ class-token has to be a token representing either a class or a struct." (stringp cur-token-name)) (set aslot nil asignal nil) - ;;LABEL - unsets both Q_SIGNALS and Q_SLOTS + ;;LABEL - unsets both signals and slots ) ((and (eq cur-token 'variable) @@ -313,8 +313,8 @@ class-token has to be a token representing either a class or a struct." ) ((not (stringp cur-token-name)) (cond - ((kde-label-Q_SIGNALS (car (semantic-token-extent elt))) - ;;SIGNALS - next prototypes belong to Q_SIGNALS and we don't want to + ((kde-label-signals (car (semantic-token-extent elt))) + ;;SIGNALS - next prototypes belong to signals and we don't want to ;; expand those (set asignal t aslot nil) @@ -324,8 +324,8 @@ class-token has to be a token representing either a class or a struct." ;; so we do ;) (set namespace (kde-label-namespace (car (semantic-token-extent elt)))) ) - ((kde-label-Q_SLOTS (car (semantic-token-extent elt))) - ;;SLOTS - for now just unset Q_SIGNALS + ((kde-label-slots (car (semantic-token-extent elt))) + ;;SLOTS - for now just unset signals (set aslot t asignal nil) ) diff --git a/scripts/kde-emacs/kde-emacs-vars.el b/scripts/kde-emacs/kde-emacs-vars.el index b2333b30..216e64f5 100644 --- a/scripts/kde-emacs/kde-emacs-vars.el +++ b/scripts/kde-emacs/kde-emacs-vars.el @@ -39,7 +39,7 @@ ;*---------------------------------------------------------------------*/ (defconst kde-access-labels - "\\<\\(Q_SIGNALS\\|k_dcop\\|\\(public\\|protected\\|private\\)\\([ ]+Q_SLOTS\\)?\\)\\>:" + "\\<\\(signals\\|k_dcop\\|\\(public\\|protected\\|private\\)\\([ ]+slots\\)?\\)\\>:" "KDE specific access labels regexp.") (defconst kde-source-files '("cpp" "cc" "cxx" "CC" "C" "c") -- cgit v1.2.1