0

I have a file "restaurants.org" containing:

#+title: Restaurants
#+author: xyz
#+COLUMNS: %Where %Name 

* Ristorante Y
:PROPERTIES:
:Where: Canal Street 10
:Name: Ristorante Y

I wanted to search according to https://orgmode.org/worg/org-tutorials/advanced-searching.html :

C-c a m 
Match: Name={Ristorante}

But no results are shown.

The file init.el looks like this:

;; -*- mode: elisp -*-

;; Disable the splash screen (to enable it agin, replace the t with 0)
(setq inhibit-splash-screen t)

;; Enable transient mark mode
(transient-mark-mode 1)

(add-hook 'text-mode-hook 'turn-on-visual-line-mode)

;;;;Org mode configuration
;; Enable Org mode
(require 'org)
;; Make Org mode work with files ending in .org
;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
;; The above is the default in recent emacsen

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-switchb)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(org-agenda-files
   '("C:/Users/hb/restaurants.org")))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

What has gone wrong?

1
  • Your properties drawer is missing its :END: - maybe that makes a difference?
    – NickD
    Jun 17 at 16:34

1 Answer 1

1

Adding the missing :END: to the property drawer makes the search work for me:

* Ristorante Y
:PROPERTIES:
:Where: Canal Street 10
:Name: Ristorante Y
:END:

If you are adding properties by hand, you might want to use the C-c C-x p keybinding (which runs the command org-set-property). That will take care of such details, so you don't have to worry about them.

You might also want to get in the habit of checking your files for such errors with M-x org-lint. If I run this on the file without the closing :END:, I am told:

6 low   Possible incomplete drawer ":PROPERTIES:"

Line 6 is the line with the :PROPERTIES: drawer header.

2
  • Thanks a lot! That worked!
    – Hababa
    Jun 17 at 17:35
  • If the answer has solved your problem, please accept it. Check out the Help (click on the ? icon in the upper right) to learn how to use the site.
    – NickD
    Jun 18 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.